<?php 
if($_SERVER['REQUEST_METHOD']=='POST'){
		$grade=$_POST['grd'];
		$subject=$_POST['sbj'];
		$teacher=$_POST['tchr'];
		
//Here we will record the last select we've been selected
		switch ($grade) {
			case '4 ESO':
				$g1='selected';
				break;
			case '3r ESO':
				$g2='selected';
				break;
			case '2n ESO':
				$g3='selected';
				break;
			case '1r ESO':
				$g4='selected';
				break;	
		}
		switch ($subject) {
			case 'Castella':
				$s1='selected';
				break;
			case 'Catala':
				$s2='selected';
				break;
			case 'Angles':
				$s3='selected';
				break;
			case 'Naturals':
				$s4='selected';
				break;
			case 'Socials':
				$s5='selected';
				break;
			case 'Matematiques':
				$s6='selected';
				break;
			case 'Musica':
				$s7='selected';
				break;
			case 'Fisica':
				$s8='selected';
				break;
		}
		switch ($teacher) {
			case 'Joan':
				$t1='selected';
				break;
			case 'Pepito':
				$t2='selected';
				break;
			case 'Miquel':
				$t3='selected';
				break;
		}
	}
?>